package com.shujia.wyh.day13.maipiao_test1;

public class Windows extends Thread {
    private static int tickets = 100;

    @Override
    public void run() {
//        int tickets = 100;
        while (true) {
            if (tickets > 0) {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("当前" + getName() + "正在出售第" + (tickets--) + "张票");
            }
        }

    }
}
